﻿using Inovout.Kuajing.Lottery.Models;
using Inovout.Kuajing.Lottery.Repositories;
using Inovout.Services;
using NHibernate.Criterion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Kuajing.Lottery.Services
{
    public class RedPacketService : RepositoryService<RedPacket>, IRedPacketService
    {
       
        public IList<RedPacket> FindRedPacketByActive(Active active) 
        {
            if (active != null)
            {
                return base.Repository.FindAll(Restrictions.Eq("Active.Id", (object)active.Id),
                    Restrictions.Eq("Status", 1));
            }
            else
            {
                return base.Repository.FindAll();
            }
        }

        
    }
}
